package com.dy.design_pattern_study.flyweight_pattern.dome2;

import com.dy.design_pattern_study.flyweight_pattern.dome2.factory.FlyweightFactory;
import com.dy.design_pattern_study.flyweight_pattern.dome2.impl.UnsharedConcreteFlyweight;

/**
 * @CreateBy zhangdingyi
 * @Date 2023-04-23
 * @Content
 */
public class client {
    public static void main(String[] args) {
        int extrinsicstate = 22;

        FlyweightFactory f = new FlyweightFactory();

        Flyweight fx = f.getFlyweight("X");
        fx.operation(--extrinsicstate);

        Flyweight fy = f.getFlyweight("Y");
        fy.operation(--extrinsicstate);

        Flyweight fz = f.getFlyweight("Z");
        fz.operation(--extrinsicstate);

        Flyweight uf = new UnsharedConcreteFlyweight();
        uf.operation(--extrinsicstate);
    }
}
